'use strict';

const Service = require('egg').Service;

class ProductService extends Service {

  async list(params) {
    const products = await this.app.mysql.select('product', {
      limit: params.pageSize * 1,
      offset: params.pageSize * (params.page - 1),
    });
    return products;
  }
}

module.exports = ProductService;
